import { getSearchListAPI } from '@/api'
export default {
  namespaced: true,
  state: {
    searchList: {}
  },
  mutations: {
    GETSEARCHLIST(state, data) {
      state.searchList = data
    }
  },
  actions: {
    async getSearchList({ commit }, query) {
      const data = await getSearchListAPI(query)
      commit('GETSEARCHLIST', data)
    }
  },
  getters: {
    goodsInfo: state => state.searchList.goodsList,
    attrsList: state => state.searchList.attrsList,
    trademarkList: state => state.searchList.trademarkList,
    total: state => state.searchList.total,
  }
}
